import java.util.Stack;

/**
 * Created by zhang_j on 2020/6/30
 */
public class CQueue {

    Stack<Integer> firstStack ;

    public CQueue() {
        firstStack = new Stack<>();
    }

    public void appendTail(int value) {
        firstStack.push(value);
    }

    public int deleteHead() {
        if(firstStack.empty()){
            return -1;
        }
        return firstStack.remove(0);
    }

    public static void main(String[] args) {
        CQueue cQueue = new CQueue();
        System.out.println(cQueue.deleteHead());
        cQueue.appendTail(5);
        cQueue.appendTail(2);
        System.out.println(cQueue.deleteHead());
        System.out.println(cQueue.deleteHead());
    }
}
